﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <!--Цвета для кнопки-->
    <SolidColorBrush x:Key="Button.Static.Background" Color="WhiteSmoke"/>
    <SolidColorBrush x:Key="Button.Static.Border" Color="#FF4CB034"/>
    <SolidColorBrush x:Key="Button.MouseOver.Background" Color="LightGray"/>
    <SolidColorBrush x:Key="Button.MouseOver.Border" Color="LightGreen"/>
    <SolidColorBrush x:Key="Button.Pressed.Background" Color="Transparent"/>
    <SolidColorBrush x:Key="Button.Pressed.Border" Color="Black"/>
    <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
    <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
    <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>

    <!--Основной стиль кнопок-->
    <Style x:Key="ButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
        <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Margin" Value="5"/>
        <Setter Property="FontSize" Value="16"/>
        <Setter Property="FontFamily" Value="Calibri"/>
        <Setter Property="Height" Value="35"/>
        <Setter Property="BorderThickness" Value="3"/>
        <Setter Property="Template">

            <!--Остальные установки стилей для кнопок-->
            <Setter.Value>

                <ControlTemplate TargetType="{x:Type Button}">

                    <!--Закругленная рамка для кнопок-->
                    <Border x:Name="border" 
                            CornerRadius="5"
                            Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" 
                            BorderThickness="{TemplateBinding BorderThickness}" 
                            SnapsToDevicePixels="true">

                        <ContentPresenter x:Name="contentPresenter" 
                                          Focusable="False" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          Margin="{TemplateBinding Padding}" 
                                          RecognizesAccessKey="True" 
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>

                    <!--Триггеры для кнопок-->
                    <ControlTemplate.Triggers>

                        <!--По умолчанию-->
                        <Trigger Property="IsDefaulted" Value="true">
                            <Setter Property="BorderBrush" 
                                    TargetName="border" 
                                    Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                        </Trigger>

                        <!--При наведении-->
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Background" 
                                    TargetName="border" 
                                    Value="{StaticResource Button.MouseOver.Background}"/>
                            <Setter Property="BorderBrush" 
                                    TargetName="border" 
                                    Value="{StaticResource Button.MouseOver.Border}"/>
                        </Trigger>

                        <!--При нажатии-->
                        <Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" 
                                    TargetName="border" 
                                    Value="{StaticResource Button.Pressed.Background}"/>
                            <Setter Property="BorderBrush" 
                                    TargetName="border" 
                                    Value="{StaticResource Button.Pressed.Border}"/>
                        </Trigger>

                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>

        </Setter>
    </Style>

</ResourceDictionary>